﻿using System;

namespace 基类和派生类
{

    internal class BaseClass
    {
        protected int _id { get; set; }
        protected string _name { get; set; } = "ShengYu";

        public BaseClass()
        {
            Console.WriteLine("[INFO] BaseClass.");
        }
        public void SetName(string name)
        {
            this._name = name;
        }
        public void GetName()
        {
            Console.WriteLine($"{this._name}");
        }
    }

    internal class DerivedClass : BaseClass
    {
        public DerivedClass()
        {
            // base.SetName("ShengYu");
        }
        public new void GetName()
        {
            Console.WriteLine($"DerivedClass:{this._name}");
        }
    }

    internal class Program
    {
        static void Main(string[] args)
        {
            new DerivedClass().GetName();
        }

    }
}
